package com.ruoyi.cencat.service.impl;

import com.ruoyi.cencat.mapper.CencatGetDataMapper;
import com.ruoyi.cencat.service.CencatGetDataService;
import com.ruoyi.common.myconmon.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CencatGetDataServiceImpl implements CencatGetDataService {
    @Autowired
    private CencatGetDataMapper cencatGetDataMapper;

    @Override
    public Result getSupplierCount() {
        return Result.success(cencatGetDataMapper.getTotalSupplierCount());
    }

    @Override
    public Result getCustomerCount() {
        return Result.success(cencatGetDataMapper.getTotalCustomerCount());
    }

    @Override
    public Result getGoodsCount() {
        return Result.success(cencatGetDataMapper.getTotalGoodsCount());
    }

    @Override
    public Result getInCount() {
        return Result.success(cencatGetDataMapper.getTotalInboundCount());
    }

    @Override
    public Result getOutCount() {
        return Result.success(cencatGetDataMapper.getTotalOutboundCount());
    }

    @Override
    public Result getWarehouseUtilization() {
        return Result.success(cencatGetDataMapper.getWarehouseUtilizationRate(100));
    }

    @Override
    public Result getRecentOperation() {
        return Result.success(cencatGetDataMapper.getRecentOperations());
    }
}
